<?php
	$css_list[0]['url'] = './tpl/css/setting.css';
	$js_list[0] = './public/js/city.js';
?>
<!--{template inc/header_n}-->
<div id="body" class="fm960">
	<div class="piece1">
		<div class="piece1_hd"></div>
		<div class="piece1_bd clearfix">
			<div style="width:1180px;">
				<!--{template inc/settings/settings_menu}-->
				<div id="setting_box" class="fl">
					<div id="setting_form" class="setting_basic">
						<form id="myform" action="{u shareinfo/saveinfo}" method="post" name="saveinfo" enctype="multipart/form-data">
							<dl>
								<dd>商家名称：</dd>
								<dt class="email">
                                {$shopinfo['name']}
								</dt>
								<dd>商家地点：</dd>
								<dt class="location">
                                    {$shopinfo['province_show']}{$shopinfo['city_show']}
								</dt>
								<dd>商家地址：</dd>
								<dt class="email">
									<input id="address" name="address" type="text" value="{$shopinfo['address']}" style="height: 24px;width: 200px;" />
									<div class="iner"><span>*</span></div>
								</dt>
								<dd>所属分类：</dd>
								<dt class="unick">
								    {if empty($shopinfo['cate_id'])}
									<select id="pcate" onchange="showcate(this.value)">
									    {loop $cate_list $v}
									    <option value="{$v['cate_id']}"{if $shopinfo['cate_id']==$v['cate_id']} selected{/if}>{$v['cate_name']}</option>
									    {/loop}
									</select>
									<span id="cate_wrap"></span>
									{else}
									{$cate_name}*
									{/if}
								</dt>
								<dd>电话号码：</dd>
								<dt class="email">
									<input id="telphone" name="telphone" type="text" value="{$shopinfo['telphone']}" style="height: 24px;width: 200px;" />
									<div class="iner"><span></span></div>
								</dt>
								<dd>电话号码2：</dd>
								<dt class="email">
									<input id="telphone2" name="telphone2" type="text" value="{$shopinfo['telphone2']}" style="height: 24px;width: 200px;" />
									<div class="iner"><span></span></div>
								</dt>
								<dd>手机号码：</dd>
								<dt class="email">
									<input id="mobile" name="mobile" type="text" value="{$shopinfo['mobile']}" style="height: 24px;width: 200px;" />
									<div class="iner"><span></span></div>
								</dt>
								<dd>手机号码2：</dd>
								<dt class="email">
									<input id="mobile2" name="mobile2" type="text" value="{$shopinfo['mobile2']}" style="height: 24px;width: 200px;" />
									<div class="iner"><span></span></div>
								</dt>
								<dd>商家LOGO：</dd>
								<dt class="email">
									<input name="img" type="file" />
									{if !empty($shopinfo['img'])}<p><img src="{$shopinfo['img']}" width="150"/></p>{/if}
									<div class="iner"><span>*</span>宽高最小257px最大600px</div>
								</dt>
								<dd>商家描述：</dd>
								<dt class="unick">
                                    <script type="text/plain" id="content" name="content"></script>
								</dt>
								<dd>&nbsp;&nbsp;</dd>
								<dt>
									<input class="green_button" type="submit" value="确定">
								</dt>
							</dl>
						</form>
					</div>
				</div>
			</div>
		</div>
		<div class="piece1_ft"></div>
	</div>
	
	<div class="huoguojun2" id="huoguojun"><a href="/list.php?action=robot"><img src="/public/v1/img/huoguojun.png"></a></div>
    <div class="i_notice2">
        <div class="j_title">公告栏</div>
        <div class="j_list">
            <ul>
                <li><a href="#"><span style="color:red;">泡泡火锅加盟,提供个大卫视广告宣传</span></a></li>
                <li><a href="#">火锅怎么做才好吃?</a></li>
                <li><a href="#">谁能给我一份火锅配菜全谱?</a></li>
                <li><a href="#">火锅一般而言,是以锅为器具</a></li>
                <li><a href="#">泡泡火锅加盟,提供个大卫视广告宣传</a></li>
                <li><a href="#">火锅怎么做才好吃?</a></li>
                <li><a href="#">谁能给我一份火锅配菜全谱?</a></li>
                <li><a href="#">火锅一般而言,是以锅为器具</a></li>
            </ul>
        </div>
    </div>
</div>
<script type="text/javascript" src="/public/js/"></script>
<script type="text/javascript" charset="utf-8" src="/public/js/ueditor1_4_3-utf8-php/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="/public/js/ueditor1_4_3-utf8-php/ueditor.all.js"></script>
<script type="text/javascript" charset="utf-8" src="/public/js/jquery.form.min.js"></script>
<script type="text/javascript">
jQuery(function($){
	$.Bind_City("#province","#city","{if empty($shopinfo['province'])}{$_FANWE['user']['reside_province']}{else}{$shopinfo['province']}{/if}","{if empty($shopinfo['city'])}{$_FANWE['user']['reside_city']}{else}{$shopinfo['city']}{/if}");
});

var editor = UE.getEditor('content',{
    //这里可以选择自己需要的工具按钮名称,此处仅选择如下五个
    toolbars:[['FullScreen', 'Undo', 'Redo','Bold',{if $_FANWE['uid']==1}'link', 'unlink',{/if}'simpleupload','preview']],
    //focus时自动清空初始化时的内容
    autoClearinitialContent:true,
    //关闭字数统计
    wordCount:false,
    //关闭elementPath
    elementPathEnabled:false,
    //默认的编辑区域高度
    initialFrameHeight:200,
    initialFrameWidth:500,
    //更多其他参数，请参考ueditor.config.js中的配置项
    serverUrl: '/public/js/ueditor1_4_3-utf8-php/php/controller.php'
});
editor.ready(function(){
    this.setContent('{$shopinfo['content']}');
});

function resetform() {
    $('#name').val('');
    $('#telphone').val('');
    $('#telphone2').val('');
    $('#mobile').val('');
    $('#mobile2').val('');
    $('#address').val('');
    editor.setContent('');
}

$('#myform').ajaxForm(function(s) {
	alert(s);
	if(s == '资料提交成功！') {
	    {if $_FANWE['uid']==1 && !$id}
	    resetform();
	    {elseif !$id}
		location.href = '/shareinfo.php?action=pubinfo';
		{/if}
	}
});

function showcate(pid) {
	$.get('/shareinfo.php?action=getcate&type=3&pid='+pid,function(s) {
		$('#cate_wrap').html(s);
	});
}
showcate($('#pcate').val());
</script>
<!--{template inc/footer}-->